package com.yl.auth.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yl.auth.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ln
 * @since 2023-07-18
 */
public interface UserMapper extends BaseMapper<User> {


    IPage<User> findAllUser(Page<User> page1);
    @Insert("insert into user_role(user_id,role_id)\n" +
            "values(#{uid},#{id})")
    void saveuser(@Param("id") Integer id, @Param("uid") Integer uid);

    @Select("select max(id) from user")
    Integer selectMaxId();


    User getPrimId(@Param("id") Integer id);

    User getZhangHaoSheZhi(@Param("id") Integer id);

}
